
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<%@ page import="com.gph.saviorframework.common.model.User" %>
<%@ page import="org.apache.shiro.SecurityUtils" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
  pageContext.setAttribute("base", basePath);
  String Error_Message = (String) request.getSession().getAttribute("err");
  request.getSession().removeAttribute("err");

  response.setHeader("progma", "no-cache");
  response.setHeader("Cache-Control", "no-cache");
  response.setHeader("Cache-Control", "no-store");
  response.setDateHeader("Expires", 0);
%>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  <!-- <meta name=”renderer” content=”webkit|ie-comp|ie-stand” /> -->
  <meta name=”renderer” content=”webkit”/>
  <title>'科学'号-找回密码</title>
  <meta name="description" content="User login page"/>
  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
  <base href="<%=basePath%>"/>
  <meta http-equiv="pragma" content="no-cache"/>
  <meta http-equiv="cache-control" content="no-cache"/>
  <meta http-equiv="expires" content="0"/>
  <meta http-equiv="keywords" content=""/>
  <link href="${ctx}/css/bootstrap.min.css" rel="stylesheet" />
  <link rel="stylesheet" href="${ctx}/css/font-awesome.min.css" />
  <!-- page specific plugin styles -->
  <link rel="stylesheet" href="${ctx}/css/jquery-ui-1.10.3.custom.min.css" />
  <link rel="stylesheet" href="${ctx}/css/bootstrap-timepicker.css" />

  <!-- ace styles -->
  <link rel="stylesheet" href="${ctx}/css/ace.min.css" />
  <link rel="stylesheet" href="${ctx}/css/ace-rtl.min.css" />
  <link rel="stylesheet" href="${ctx}/css/ace-skins.min.css" />
  <!-- fonts -->
  <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" />
  <!--my css-->
  <link rel="stylesheet" href="${ctx}/css/base.css">
  <link rel="stylesheet" href="${ctx}/css/style.css">
  <!-- ace settings handler -->
  <script src="${ctx}/js/ace-extra.min.js"></script>
  <script type="text/javascript" src="${ctx}/js/jquery-1.10.2.min.js"></script>
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <!--[if lte IE 8]>
  <style>
    body {
      overflow-x: hidden;
    }

    input {
      line-height: 43px;
    }
  </style>
  <![endif]-->
</head>


<body>
<div class="bg" style="min-height: 600px;">
  <div class="container">
    <div class="toph">
      <div class="top_l">
        <img src="${ctx}/images/logo.png" alt="">
        <span>"科学"号线上运行管理平台 | 找回密码</span>
      </div>
      <div class="top_r">
        <span><a href="${ctx}/login">返回登录</a></span>
      </div>
    </div>
    <div class="rigis_m" style="height:290px;">

      <div class="in_b">
        <form id="mform" name="mform" >
          <div class="passform" style="width:570px;margin:0 auto;padding-top:15px;">
        <span>邮箱</span>
            <input class="passinput" type="text" name="input" id="minput"  placeholder="请输入用户名或邮箱" />
          </div>
        </form>
      </div>
      <div class="in_b">
        <input class="passbut" type="submit"   value="点击发送邮件" id="J_submit" style="width:180px;heihgt:30px;background:#4b83b2;border:0;border-radius: 5px;font-size: 16px;color:#fff;margin-top:30px;"/>
        <div style="display: none"><span id="mes">3</span></div>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript" src="${ctx}/assets/admin/LingUI/login/js/jquery.tips.js"></script>
<script type="text/javascript" src="${ctx}/assets/admin/LingUI/login/js/base64.js"></script>
<script type="text/javascript" src="${ctx}/assets/admin/LingUI/js/jquery.validate.js"></script>
<script src="${ctx}/assets/admin/LingUI/js/layer/layer.js" type="text/javascript"></script>
<script src="${ctx}/assets/admin/LingUI/js/layer/layer.lui.js" type="text/javascript"></script>
<script src="${ctx}/assets/admin/LingUI/js/jquery/jquery-form.js" type="text/javascript"></script>
<script src="${ctx}/assets/admin/LingUI/js/jquery.backstretch.min.js"></script>
<script type="text/javascript" src="${ctx}/assets/admin/LingUI/js/jsutil/browser.js"></script>
<script type="text/javascript">
  $(function () {
    var hehh = '';
    hehh = ($(window).height()- 497)/2;
    $.backstretch("${base}/assets/admin/LingUI/login/images/beijing.png");
    $('.psaadiv').css('margin-top',hehh);

  });
  $('#J_submit').on('click', function () {
      this.disabled= true;
      var that =this;
        if ($('#minput').val() != "") {
          $('#mform').ajaxSubmit({
            url: "${ctx}/send-email",
            type: "post",
            dataType: 'json',
            success: function (data) {
              if (data.success) {
                $('#minput').val('');
                lui.success('邮件发送成功，请前往邮箱进行密码重置！');
                var i = 3;
                var intervalid;
                intervalid = setInterval("fun(3)", 1000);
              }
              else {
                lui.fail(data.info);
                //debugger;
                that.disabled =false;
              }
            },
            error:function(){
                lui.fail('邮件发送失败！');
                that.disabled =false;
            }
          });
        }
        else {
          lui.fail('请输入用户名或邮箱！');
          //debugger;
          that.disabled =false;
          return false;
        }
  });
  function fun(i) {
    document.getElementById("mes").innerHTML = i;
    if (i == 3) {
      location.href = "${ctx}/login";
      clearInterval(intervalid);
    }

  }
</script>
</body>
</html>
